import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';

@Schema({
  id: false,
  versionKey: false,
  timestamps: true,
})
export class Article {
  @Prop({ required: true })
  title: string;

  @Prop({ required: true })
  content: string;

  @Prop({ required: true })
  author: string;

  @Prop({ required: true })
  tags: string[];
}

// 创建文章的Schema
export const ArticleSchema = SchemaFactory.createForClass(Article);
